{% extends "test.html"%}
{% import "_macros.html" as mr %}

{% block title %}
<h3>
关注{{ user.username }}的人
</h3>
<p>那些虚怀若谷的人一定很快乐吧</p>
{% endblock %}

{% block post %}
<table class="table table-hover followers">
    <thead>
    <tr>
        <th>用户</th>
        <th>关注时间</th>
        <th> 操作</th>
    </tr>
    </thead>
    {% for follow in follows %}

    <tr>
        <td>
            <a href="{{ url_for('profileid', username = follow.follower.username) }}">
                <img class=" img-circle" src="{{ follow.follower.avatar }}" width="70" height="70">
                {{ follow.follower.username }}
            </a>
        </td>
        <td>
            {{ follow.times }}

        </td>

 {% if current_user.is_authenticated  %}
        {% if follow.follower != current_user %}
        <td>
              {% if not current_user.is_following(follow.follower) %}
            <a href="{{url_for('follow',username=follow.follower.username)}}" class="more_btn">关注</a>
            {% else %}
            <a href="{{url_for('unfollow',username=follow.follower.username)}}" class="more_btn">取消关注</a>
            {% endif %}
        </td>
        {% endif%}
        {% else %}
        <td> <a href="{{url_for('follow',username=follow.follower.username)}}" class="more_btn">关注</a></td>
 {% endif %}

    </tr>

    {% endfor %}
</table>
{{ mr.pagination_widget(pagination,'followers',user.username)}}
{% endblock%}
{%block col%}
{% endblock%}